package com.xiaoyu.im.config;

import android.text.TextUtils;

import com.xiaoyu.base.AppConfig;
import com.xiaoyu.base.BaseConstants;
import com.xiaoyu.base.utils.SharedPreferencesData;

import in.srain.cube.util.Env;

public class HttpConfig {
    private static final String DEV_MODE_HOST = SharedPreferencesData.basic() == null ? "" : SharedPreferencesData.basic().getString(BaseConstants.SharedPreferencesKey.KEY_DEV_MODE_HOST, "");

    private static String sHost = Env.isDevOrInDevMode() && !TextUtils.isEmpty(DEV_MODE_HOST) ? DEV_MODE_HOST : AppConfig.host();

    public static final String SCHEME = "https";
    public static final String BASE_URL = String.format("%s://%s", SCHEME, sHost);

    private static final String API_PREFIX = "/api";
    private static final String BASE_API_URL = BASE_URL + API_PREFIX;

    public static final String UTIL_CONFIRM_SYSTEM_MESSAGE = BASE_API_URL + "/util/confirm-system-message";

    public static final String IM_TOKEN_REFRESH = BASE_API_URL + "/im/token-refresh";
    public static final String IM_CHAT_INFO_LIST = BASE_API_URL + "/im/chat-info-list";
    public static final String IM_UPDATE_CHAT = BASE_API_URL + "/im/update-chat";
    public static final String IM_CREATE_CHAT = BASE_API_URL + "/im/create-chat";
}

